package com.zoe.onelink.common.exception.http;

import com.zoe.onelink.common.enumeration.ExceptionCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2022</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2022-05-26
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class HttpClientException extends RuntimeException {

    private static final long serialVersionUID = -8834945181678275354L;

    private String url;

    private String method;

    private Object data;

    private int statusCode;

    private Map<String, String> header;

    private Object param;

    private int connectTimeoutMillis;

    private int callTimeoutMillis;

    private ExceptionCode exceptionCode;

    private Object[] exceptionParams;

    public HttpClientException() {
    }

    public HttpClientException(ExceptionCode exceptionCode, Object... exceptionParams) {
        this.exceptionCode = exceptionCode;
        this.exceptionParams = exceptionParams;
    }

    public HttpClientException(String message) {
        super(message);
    }

    public HttpClientException(String message, Throwable cause) {
        super(message, cause);
    }

    public HttpClientException(Throwable cause) {
        super(cause);
    }

    public HttpClientException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }


}
